﻿using SPOooON.TileWorld.Model;
using SPOooON.TileWorld.Service;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SPOooON.TileWorld.Editor
{
    class EditorController : IObservable<EditorController>
    {
        private List<IObserver<EditorController>> observers = new List<IObserver<EditorController>>();


        public World CurrentWorld { get; set; }
        public IWorldService WorldService { get; set; }

        public EditorController(IWorldService worldService)
        {
            this.WorldService = worldService;
        }

        IDisposable IObservable<EditorController>.Subscribe(IObserver<EditorController> observer)
        {
            if (!observers.Contains(observer)) observers.Add(observer);
        }

        public class Unsubscriber : IDisposable
        {
            private List<IObserver<EditorController>> observers;
            private IObserver<EditorController> observer;
        }
    }
}